package org.dromara.common.translation.core.impl;

import lombok.AllArgsConstructor;
import org.apache.dubbo.config.annotation.DubboReference;
import org.dromara.bclt.api.RemoteDeviceInfoService;
import org.dromara.common.translation.annotation.TranslationType;
import org.dromara.common.translation.constant.TransConstant;
import org.dromara.common.translation.core.TranslationInterface;

/**
 * 设备用户昵称翻译实现
 *
 * @author may
 */
@AllArgsConstructor
@TranslationType(type = TransConstant.DEVICE_ID_TO_NUMBER)
public class DeviceNumberTranslationImpl implements TranslationInterface<String> {

    @DubboReference
    private RemoteDeviceInfoService remoteDeviceinfoService;

    @Override
    public String translation(Object key, String other) {
        System.out.println(key.toString());
        return remoteDeviceinfoService.selectDeviceNumberById((Long) key);

    }
}
